package chap10collection.test2;

import java.util.List;
import java.util.Vector;

/**
 * @author zdl
 * @date 2024/12/17
 */
public class Demo2 {
    public static void main(String[] args) {
        //List list = new ArrayList();
       // List list = new LinkedList();
        List list = new Vector();
        list.add("Hello");
        list.add("World");
        list.add(1, "Learn");
        list.add(1, "Java");

        printList(list);    //Hello Java    Learn   World
    }
    public static void printList(List list){
        //1 1) 把//1 处的代码补充完整，要求输出 list 中所有元素的内容
        for (Object o : list) {
            System.out.println(o);
        }
    }

}
